export default {
	namespaced:true,
	state:()=>{
			return {
				address:JSON.parse(uni.getStorageSync('address')  || '{}'),
			}
		},
		mutations:{
			// 更新收货地址
			updateAddress(state,address){
				state.address = address;
				// 永久存储
				this.commit('user_m/saveAddressToStorage')
			},
			saveAddressToStorage(state){
				uni.setStorageSync('address',JSON.stringify(state.address));
			}
		},
	actions:{},
	getters:{
		addressStr(state) {
			return state.address.provinceName + state.address.cityName + state.address.countyName + state.address
				.detailInfo
		}
		
	}
}